<!--
 * @Author: Tao
 * @Date: 2021-10-22 14:17:00
 * @LastEditors: Tao
 * @LastEditTime: 2021-10-24 18:22:08
 * @Description: 
-->
<template>
  <div class="accountApply">
    <el-table :data="accountApply.list">
      <el-table-column type="index" label="序号"></el-table-column>
      <el-table-column prop="userId" label="申请人编号"></el-table-column>
      <el-table-column prop="transferTime" label="申请时间">
        <template v-slot="scope">
          {{ scope.row.transferTime | fmtDateTime}}
        </template>
      </el-table-column>
      <el-table-column prop="type" label="变更类型"></el-table-column>
      <el-table-column label="变更资金">
        <template  v-slot="scope">
        ￥{{scope.row.transferMoney}}元
        </template>
      </el-table-column>
      <el-table-column  label="变更原因"></el-table-column>
      <el-table-column label="状态">
        <template v-slot="scope">
          <el-tag v-if="scope.row.status == '正常'" type="success " size="mini">{{ scope.row.status}}</el-tag>
          <el-tag v-else type="danger" size="mini">{{ scope.row.status}}</el-tag>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页插件 -->
    <el-pagination
      background
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="accountApply.page"
      :page-sizes="[8, 10, 12, 15]"
      :page-size="accountApply.pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="accountApply.total">
    </el-pagination>
  </div>
</template>
<script>
import request from "@/utils/request"
export default {
  data(){
    return{
      accountApply:[],
      queryParams:{
        page:1,
        pageSize:10
      }
    }
  },
  methods:{
    fillAllaccountApply(){
      request.get('/account/pageQueryEmployeeAccount',{
        params: {
          page:1,
          pageSize:10
        }
      }).then(res => {
        // console.log(res);
        this.accountApply = res.data;
      })
    },
    handleSizeChange(page){
      this.queryParams.page = page;
      this.fillAllaccountApply()
    },
    handleCurrentChange(pageSize){
      this.queryParams.pageSize = pageSize;
      this.fillAllaccountApply();
    }
  },
  created(){
    this.fillAllaccountApply();
  }
}
</script>
